package Thread;

public class demo10 {
    public static void main(String[] args) {
        String s = "abc12345";
        int len = 0,begin = 0;
        int n = s.length();
        for(int i = 0;i < n;i++) {
            if(s.charAt(i) >= '0' && s.charAt(i) <= '9') {
                int right = i;
                while(right < n && s.charAt(right) >= '0' && s.charAt(right) <= '9') {
                    right++;
                }
                if(right - i > len) {
                    begin = i;
                    len = right - i;
                }
                i = right;
            }
        }
        System.out.println(s.substring(begin,begin + len));
    }
}
